package com.huo.pattern.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicProxy implements InvocationHandler {

    private Person person;
    public DynamicProxy(Person person) {
        this.person = person;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("parent say:" + args.toString());
        method.invoke(person, args);
        System.out.println("Good");
        return  null;
    }
}
